package com.yanqu.road.entity.wingroom.workshop;

import com.yanqu.road.entity.DataObject;

import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author ：zfr
 * @date ：2022/3/20 15:02
 */
public class UserWorkShopData extends DataObject {
    private long userId;
    private WorkShopPool workShopPool;
    private Map<Integer, WorkShopBuyCount> buyCountMap = new ConcurrentHashMap<>();
    private long userRefreshTime;
    private int refreshTimes;
    private long timesRefreshTime;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public WorkShopPool getWorkShopPool() {
        return workShopPool;
    }

    public void setWorkShopPool(WorkShopPool workShopPool) {
        if (!Objects.equals(this.workShopPool, workShopPool)) {
            this.workShopPool = workShopPool;
            setUpdateOption();
        }
    }

    public int getRefreshTimes() {
        return refreshTimes;
    }

    public void setRefreshTimes(int refreshTimes) {
        if (this.refreshTimes != refreshTimes) {
            this.refreshTimes = refreshTimes;
            setUpdateOption();
        }
    }

    public long getTimesRefreshTime() {
        return timesRefreshTime;
    }

    public void setTimesRefreshTime(long timesRefreshTime) {
        if (this.timesRefreshTime != timesRefreshTime) {
            this.timesRefreshTime = timesRefreshTime;
            setUpdateOption();
        }
    }

    public Map<Integer, WorkShopBuyCount> getBuyCountMap() {
        return buyCountMap;
    }

    public void setBuyCountMap(Map<Integer, WorkShopBuyCount> buyCountMap) {
        this.buyCountMap = buyCountMap;
        setUpdateOption();
    }

    public long getUserRefreshTime() {
        return userRefreshTime;
    }

    public void setUserRefreshTime(long userRefreshTime) {
        if (this.userRefreshTime != userRefreshTime) {
            this.userRefreshTime = userRefreshTime;
            setUpdateOption();
        }
    }
}
